import 'package:flutter/cupertino.dart';
import 'package:flutter_svg/svg.dart';

enum IconNames {
  tingzhi_1, rrl_s_049, duigou_cu, afro, businessman, clown, flirt, wrench, filter_fill, yuangongguanli, shezhi, gengduo, qunzu
}

extension parseString on IconNames {
  String serialize() => toString().split('.').last;
}

/// A class includes all icons which you provided from https://iconfont.cn
///
/// How to use it:
/// ```dart
/// IconFont(IconNames.xxx);
/// IconFont(IconNames.xxx, color: '#f00');
/// IconFont(IconNames.xxx, colors: ['#f00', 'blue']);
/// IconFont(IconNames.xxx, size: 30, color: '#000');
/// ```
///
/// The name is dynamic to against server interface.
/// Feel free to input string literal.
/// ```dart
/// IconFont('xxx');
/// ```
class IconFont extends StatelessWidget {
  IconNames? name;
  final String? color;
  final List<String>? colors;
  final double size;

  IconFont(dynamic iconName, {super.key,  this.size = 18, this.color, this.colors }) {
    name = getIconNames(iconName);
  }

  static IconNames getIconNames(dynamic iconName) {
    switch (iconName) {
      case 'tingzhi_1':
        iconName = IconNames.tingzhi_1;
        break;
      case 'rrl_s_049':
        iconName = IconNames.rrl_s_049;
        break;
      case 'duigou_cu':
        iconName = IconNames.duigou_cu;
        break;
      case 'afro':
        iconName = IconNames.afro;
        break;
      case 'businessman':
        iconName = IconNames.businessman;
        break;
      case 'clown':
        iconName = IconNames.clown;
        break;
      case 'flirt':
        iconName = IconNames.flirt;
        break;
      case 'wrench':
        iconName = IconNames.wrench;
        break;
      case 'filter_fill':
        iconName = IconNames.filter_fill;
        break;
      case 'yuangongguanli':
        iconName = IconNames.yuangongguanli;
        break;
      case 'shezhi':
        iconName = IconNames.shezhi;
        break;
      case 'gengduo':
        iconName = IconNames.gengduo;
        break;
      case 'qunzu':
        iconName = IconNames.qunzu;
        break;

    }
    return iconName;
  }

  static String getColor(int arrayIndex, String? color, List<String>? colors, String defaultColor) {
    if (color != null && color.isNotEmpty) {
      return color;
    }

    if (colors != null && colors.isNotEmpty && colors.length > arrayIndex) {
      return colors.elementAt(arrayIndex);
    }

    return defaultColor;
  }

  @override
  Widget build(BuildContext context) {
    String svgXml;

    switch (name!) {
      case IconNames.tingzhi_1:
        svgXml = '''          <svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
            <path
              d="M492.836571 985.6A492.763429 492.763429 0 1 1 492.836571 0a492.763429 492.763429 0 0 1 0 985.6z m211.163429-563.2H281.6a70.436571 70.436571 0 0 0 0 140.8h422.4a70.436571 70.436571 0 0 0 0-140.8z"
              fill="${getColor(0, color, colors, '#FF3A3A')}"
            />
          </svg>
        ''';
        break;
      case IconNames.rrl_s_049:
        svgXml = '''          <svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
            <path
              d="M902.981818 116.363636c-9.309091-20.945455-30.254545-34.909091-53.527273-34.909091H167.563636c-23.272727 0-44.218182 13.963636-53.527272 34.909091s-4.654545 46.545455 9.309091 62.836364l279.272727 295.563636V861.090909c0 13.963636 9.309091 27.927273 23.272727 32.581818l139.636364 46.545455c4.654545 2.327273 6.981818 2.327273 11.636363 2.327273 6.981818 0 13.963636-2.327273 20.945455-6.981819 9.309091-6.981818 13.963636-16.290909 13.963636-27.927272V474.763636l279.272728-295.563636c16.290909-16.290909 20.945455-41.890909 11.636363-62.836364zM551.563636 437.527273c-6.981818 6.981818-9.309091 13.963636-9.309091 23.272727v397.963636l-69.818181-23.272727V460.8c0-9.309091-2.327273-18.618182-9.309091-23.272727L193.163636 151.272727h628.363637L551.563636 437.527273zM914.618182 581.818182c0 18.618182-16.290909 34.909091-34.909091 34.909091h-186.181818c-18.618182 0-34.909091-16.290909-34.909091-34.909091s16.290909-34.909091 34.909091-34.909091h186.181818c20.945455 0 34.909091 16.290909 34.909091 34.909091z m0 279.272727c0 18.618182-16.290909 34.909091-34.909091 34.909091h-186.181818c-18.618182 0-34.909091-16.290909-34.909091-34.909091s16.290909-34.909091 34.909091-34.909091h186.181818c20.945455 0 34.909091 16.290909 34.909091 34.909091z m0-139.636364c0 18.618182-16.290909 34.909091-34.909091 34.909091h-186.181818c-18.618182 0-34.909091-16.290909-34.909091-34.909091s16.290909-34.909091 34.909091-34.90909h186.181818c20.945455 0 34.909091 16.290909 34.909091 34.90909z"
              fill="${getColor(0, color, colors, '#A8ABB0')}"
            />
          </svg>
        ''';
        break;
      case IconNames.duigou_cu:
        svgXml = '''          <svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
            <path
              d="M863.5 265.499a8 8 0 0 0-11.314 0L439.274 678.411 263.912 503.049a8 8 0 0 0-11.314 0l-45.255 45.255a8 8 0 0 0 0 11.314l181.019 181.019 16.971 16.97 0.078 0.078 11.236 11.236c12.496 12.497 32.758 12.497 45.254 0l446.853-446.853a7.999 7.999 0 0 0 0-11.314L863.5 265.499z"
              fill="${getColor(0, color, colors, '#000000')}"
            />
          </svg>
        ''';
        break;
      case IconNames.afro:
        svgXml = '''          <svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
            <path
              d="M498.635034 366.238897c-200.350897 0-348.619034 10.081103-366.256551 22.174896-0.123586 1.50069-0.564966 494.344828-0.564966 494.344828 0 38.841379 31.77931 70.62069 70.62069 70.620689h600.275862c38.841379 0 70.62069-31.77931 70.62069-70.620689 0 0 0.759172-492.226207 0.564965-494.344828-24.399448-11.776-178.864552-22.174897-375.26069-22.174896z"
              fill="${getColor(0, color, colors, '#FFDB2B')}"
            />
            <path
              d="M512 0C234.107586 0 8.827586 177.840552 8.827586 397.241379c0 99.575172 46.521379 274.555586 123.197793 344.275862 0.123586-130.065655 0.282483-352.308966 0.353104-353.103448 17.637517-12.093793 165.905655-22.174897 366.256551-22.174896 196.378483 0 350.861241 10.398897 375.26069 22.174896 0.105931 1.165241-0.070621 234.637241-0.264827 368.904828C961.200552 685.850483 1015.172414 504.531862 1015.172414 397.241379 1015.172414 177.840552 789.892414 0 512 0z"
              fill="${getColor(1, color, colors, '#464F5D')}"
            />
            <path
              d="M485.517241 476.689655H137.268966c0 97.509517 79.042207 176.551724 176.551724 176.551724 91.542069 0 178.052414-69.684966 188.274758-158.896551H485.517241v-17.655173zM520.827586 476.689655v17.655173h-11.899586c8.862897 89.211586 84.109241 158.896552 175.668966 158.896551 97.509517 0 176.551724-79.042207 176.551724-176.551724H520.827586zM503.137103 476.689655c0 5.967448-0.370759 11.846621-1.024 17.655173h6.814897c-0.582621-5.808552-0.882759-11.687724-0.882759-17.655173h-4.908138z"
              fill="${getColor(2, color, colors, '#556080')}"
            />
            <path
              d="M485.517241 476.689655v17.655173h16.595862c0.670897-5.808552 1.024-11.687724 1.024-17.655173H485.517241zM520.827586 476.689655h-12.8c0 5.967448 0.317793 11.846621 0.882759 17.655173h11.917241v-17.655173z"
              fill="${getColor(3, color, colors, '#556080')}"
            />
            <path
              d="M503.172414 741.517241m-70.62069 0a70.62069 70.62069 0 1 0 141.241379 0 70.62069 70.62069 0 1 0-141.241379 0Z"
              fill="${getColor(4, color, colors, '#F29C1F')}"
            />
            <path
              d="M503.172414 829.793103c-48.67531 0-88.275862-39.600552-88.275862-88.275862s39.600552-88.275862 88.275862-88.275862 88.275862 39.600552 88.275862 88.275862-39.600552 88.275862-88.275862 88.275862z m0-141.241379c-29.201655 0-52.965517 23.763862-52.965517 52.965517s23.763862 52.965517 52.965517 52.965518 52.965517-23.763862 52.965517-52.965518-23.763862-52.965517-52.965517-52.965517z"
              fill="${getColor(5, color, colors, '#F0C419')}"
            />
            <path
              d="M767.646897 842.328276c3.354483-3.354483 5.296552-7.944828 5.296551-12.535173s-1.942069-9.198345-5.296551-12.535172c-6.355862-6.532414-18.537931-6.532414-24.893794 0-3.354483 3.336828-5.296552 7.944828-5.296551 12.535172s1.942069 9.18069 5.296551 12.535173c3.177931 3.177931 7.768276 5.12 12.535173 5.12 4.590345 0 9.18069-1.942069 12.358621-5.12zM755.288276 794.482759c4.590345 0 9.004138-1.942069 12.358621-5.12 3.354483-3.354483 5.296552-7.944828 5.296551-12.535173s-1.942069-9.198345-5.296551-12.535172c-6.532414-6.532414-18.361379-6.532414-24.893794 0-3.354483 3.336828-5.296552 7.944828-5.296551 12.535172s1.942069 9.18069 5.296551 12.535173c3.354483 3.177931 7.768276 5.12 12.535173 5.12zM808.077241 794.482759c4.766897 0 9.18069-1.942069 12.535173-5.12 3.354483-3.354483 5.296552-7.944828 5.296552-12.535173s-1.942069-9.198345-5.296552-12.535172c-6.532414-6.532414-18.361379-6.532414-24.893793 0-3.354483 3.336828-5.296552 7.944828-5.296552 12.535172s1.942069 9.18069 5.296552 12.535173c3.354483 3.177931 7.768276 5.12 12.35862 5.12zM795.718621 817.257931c-3.354483 3.336828-5.12 7.944828-5.12 12.535172s1.765517 9.18069 5.12 12.535173c3.354483 3.177931 7.944828 5.12 12.535172 5.12 4.590345 0 9.004138-1.942069 12.358621-5.12 3.354483-3.354483 5.12-7.944828 5.12-12.535173s-1.765517-9.198345-5.12-12.535172c-6.532414-6.532414-18.361379-6.532414-24.893793 0zM760.408276 870.223448a17.408 17.408 0 0 0-5.12 12.535173c0 4.766897 1.765517 9.18069 5.12 12.535172 3.354483 3.177931 7.768276 5.12 12.535172 5.12 4.413793 0 9.004138-1.783172 12.358621-5.12 3.354483-3.354483 5.12-7.944828 5.12-12.535172s-1.765517-9.198345-5.12-12.535173c-6.532414-6.532414-18.537931-6.355862-24.893793 0zM707.442759 870.223448c-3.354483 3.336828-5.12 7.944828-5.12 12.535173s1.765517 9.18069 5.12 12.535172c3.354483 3.177931 7.768276 5.12 12.35862 5.12 4.766897 0 9.18069-1.942069 12.535173-5.12 3.354483-3.354483 5.296552-7.944828 5.296551-12.535172s-1.942069-9.198345-5.296551-12.535173c-6.355862-6.532414-18.537931-6.532414-24.893793 0zM714.681379 842.328276c3.354483-3.354483 5.296552-7.944828 5.296552-12.535173s-1.942069-9.198345-5.296552-12.535172c-6.355862-6.532414-18.537931-6.532414-24.893793 0-3.354483 3.336828-5.296552 7.944828-5.296552 12.535172s1.942069 9.18069 5.296552 12.535173c3.177931 3.177931 7.768276 5.12 12.535173 5.12 4.590345 0 9.18069-1.942069 12.35862-5.12zM654.477241 870.223448c-3.354483 3.336828-5.296552 7.944828-5.296551 12.535173s1.942069 9.18069 5.296551 12.535172c3.354483 3.177931 7.768276 5.12 12.535173 5.12 4.590345 0 9.18069-1.942069 12.35862-5.12 3.354483-3.354483 5.12-7.944828 5.12-12.535172s-1.765517-9.198345-5.12-12.535173c-6.355862-6.532414-18.537931-6.532414-24.893793 0zM601.511724 870.223448c-3.354483 3.336828-5.12 7.944828-5.12 12.535173s1.765517 9.18069 5.12 12.535172c3.354483 3.336828 7.944828 5.12 12.358621 5.12 4.766897 0 9.18069-1.942069 12.535172-5.12a17.655172 17.655172 0 0 0 5.296552-12.535172 17.584552 17.584552 0 0 0-5.296552-12.535173c-6.355862-6.532414-18.361379-6.532414-24.893793 0zM548.546207 870.223448c-3.354483 3.336828-5.296552 7.944828-5.296552 12.535173s1.942069 9.18069 5.296552 12.535172c3.354483 3.177931 7.768276 5.12 12.535172 5.12 4.590345 0 9.004138-1.783172 12.358621-5.12 3.354483-3.354483 5.296552-7.944828 5.296552-12.535172s-1.942069-9.198345-5.296552-12.535173c-6.532414-6.532414-18.537931-6.532414-24.893793 0zM230.753103 817.257931c-3.354483 3.336828-5.12 7.944828-5.12 12.535172s1.765517 9.18069 5.12 12.535173c3.354483 3.177931 7.944828 5.12 12.535173 5.12 4.590345 0 9.004138-1.942069 12.358621-5.12 3.354483-3.354483 5.12-7.944828 5.12-12.535173s-1.765517-9.198345-5.12-12.535172c-6.532414-6.708966-18.361379-6.532414-24.893794 0zM230.753103 764.292414a17.408 17.408 0 0 0-5.12 12.535172 17.478621 17.478621 0 0 0 17.655173 17.655173 17.44331 17.44331 0 0 0 17.478621-17.655173c0-4.784552-1.765517-9.198345-5.12-12.535172-6.708966-6.532414-18.184828-6.532414-24.893794 0zM190.322759 794.482759a17.478621 17.478621 0 0 0 17.47862-17.655173c0-4.590345-1.765517-9.198345-5.12-12.535172-6.708966-6.532414-18.184828-6.532414-24.893793 0a17.408 17.408 0 0 0-5.12 12.535172 17.478621 17.478621 0 0 0 17.655173 17.655173zM202.681379 817.257931c-6.355862-6.532414-18.537931-6.532414-24.893793 0a17.408 17.408 0 0 0-5.12 12.535172 17.478621 17.478621 0 0 0 17.655173 17.655173c4.590345 0 9.18069-1.942069 12.35862-5.12 3.354483-3.354483 5.12-7.944828 5.12-12.535173s-1.765517-9.198345-5.12-12.535172zM213.097931 870.223448c-3.354483 3.336828-5.296552 7.944828-5.296552 12.535173s1.942069 9.18069 5.296552 12.535172c3.354483 3.177931 7.768276 5.12 12.535172 5.12a17.44331 17.44331 0 0 0 17.478621-17.655172c0-4.590345-1.765517-9.198345-5.12-12.535173-6.355862-6.532414-18.537931-6.532414-24.893793 0zM266.063448 870.223448c-3.354483 3.336828-5.12 7.944828-5.12 12.535173s1.765517 9.18069 5.12 12.535172c3.354483 3.177931 7.768276 5.12 12.358621 5.12 4.766897 0 9.18069-1.942069 12.535172-5.12 3.354483-3.354483 5.296552-7.944828 5.296552-12.535172s-1.942069-9.198345-5.296552-12.535173c-6.355862-6.532414-18.537931-6.532414-24.893793 0zM308.612414 817.257931c-6.355862-6.532414-18.537931-6.532414-24.893793 0-3.354483 3.336828-5.12 7.944828-5.12 12.535172s1.765517 9.18069 5.12 12.535173c3.177931 3.177931 7.768276 5.12 12.35862 5.12 4.766897 0 9.357241-1.942069 12.535173-5.12 3.354483-3.354483 5.296552-7.944828 5.296552-12.535173s-1.942069-9.198345-5.296552-12.535172zM319.028966 870.223448a17.408 17.408 0 0 0-5.12 12.535173c0 4.766897 1.765517 9.18069 5.12 12.535172 3.354483 3.177931 7.768276 5.12 12.535172 5.12 4.413793 0 9.004138-1.783172 12.358621-5.12 3.354483-3.354483 5.12-7.944828 5.12-12.535172s-1.765517-9.198345-5.12-12.535173c-6.532414-6.532414-18.537931-6.355862-24.893793 0zM389.649655 870.223448c-3.354483 3.336828-5.296552 7.944828-5.296552 12.535173s1.942069 9.18069 5.296552 12.535172c3.354483 3.177931 7.768276 5.12 12.535173 5.12 4.590345 0 9.18069-1.942069 12.35862-5.12 3.354483-3.354483 5.12-7.944828 5.12-12.535172s-1.765517-9.198345-5.12-12.535173c-6.355862-6.532414-18.537931-6.532414-24.893793 0zM442.615172 870.223448c-3.354483 3.336828-5.12 7.944828-5.12 12.535173s1.765517 9.18069 5.12 12.535172c3.354483 3.177931 7.768276 5.12 12.358621 5.12 4.766897 0 9.18069-1.942069 12.535173-5.12 3.354483-3.354483 5.296552-7.944828 5.296551-12.535172s-1.942069-9.198345-5.296551-12.535173c-6.355862-6.532414-18.537931-6.532414-24.893794 0zM495.58069 870.223448a17.408 17.408 0 0 0-5.12 12.535173c0 4.766897 1.765517 9.18069 5.12 12.535172 3.354483 3.177931 7.768276 5.12 12.535172 5.12 4.413793 0 9.004138-1.783172 12.358621-5.12 3.354483-3.354483 5.12-7.944828 5.12-12.535172s-1.765517-9.198345-5.12-12.535173c-6.532414-6.532414-18.537931-6.355862-24.893793 0z"
              fill="${getColor(6, color, colors, '#556080')}"
            />
            <path
              d="M709.614345 1024H296.677517a23.04 23.04 0 0 1-23.04-23.04V953.37931h459.034483v47.58069A23.057655 23.057655 0 0 1 709.614345 1024z"
              fill="${getColor(7, color, colors, '#FEC722')}"
            />
            <path
              d="M868.758069 273.037241l-49.928828-49.928827v-0.017655h-0.017655L669.025103 73.268966a18.184828 18.184828 0 0 0-24.964413 0l-49.946483 49.946482a17.637517 17.637517 0 1 0 24.964414 24.964414l37.464276-37.464276 24.964413 24.982069-37.464276 37.464276a17.637517 17.637517 0 1 0 24.964414 24.964414L706.471724 160.662069l24.964414 24.982069-37.464276 37.446621a17.637517 17.637517 0 1 0 24.964414 24.964413l37.446621-37.44662 24.964413 24.964414-37.44662 37.464275a17.637517 17.637517 0 1 0 24.964413 24.964414l37.446621-37.464276 24.982069 24.982069-37.464276 37.446621A17.637517 17.637517 0 0 0 806.329379 353.103448a17.637517 17.637517 0 0 0 12.482207-5.172965l49.946483-49.928828a17.602207 17.602207 0 0 0 0-24.964414z"
              fill="${getColor(8, color, colors, '#ECF0F1')}"
            />
            <path
              d="M235.890759 476.689655l-40.483311 40.483311a17.637517 17.637517 0 1 0 24.964414 24.964413L285.819586 476.689655h-49.928827zM341.821793 476.689655l-75.793655 75.793655a17.637517 17.637517 0 1 0 24.964414 24.964414L391.750621 476.689655h-49.928828zM604.407172 476.689655l-38.594206 40.836414a17.655172 17.655172 0 0 0 25.67062 24.258207L652.994207 476.689655h-48.587035zM712.580414 476.689655l-75.793655 75.793655a17.637517 17.637517 0 1 0 24.964413 24.964414L762.509241 476.689655h-49.928827z"
              fill="${getColor(9, color, colors, '#8697CB')}"
            />
          </svg>
        ''';
        break;
      case IconNames.businessman:
        svgXml = '''          <svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
            <path
              d="M905.846154 455.325538H137.846154L183.906462 124.987077A110.355692 110.355692 0 0 1 293.257846 29.538462h457.176616a110.355692 110.355692 0 0 1 109.351384 95.448615L905.846154 455.325538z"
              fill="${getColor(0, color, colors, '#556080')}"
            />
            <path
              d="M881.132308 278.094769H162.56l-5.395692 38.734769c1.083077 0.177231 2.067692 0.649846 3.190154 0.649847h723.003076c1.122462 0 2.107077-0.452923 3.190154-0.649847l-5.415384-38.734769zM892.120615 356.864H151.571692l-5.395692 38.695385c1.161846 0.216615 2.205538 0.689231 3.426462 0.68923h744.487384c1.220923 0 2.264615-0.472615 3.426462-0.68923l-5.395693-38.695385z"
              fill="${getColor(1, color, colors, '#8697CB')}"
            />
            <path
              d="M984.615385 590.769231c0-37.376-26.328615-75.598769-59.076923-88.615385-5.454769-30.857846-19.692308-46.828308-19.692308-46.828308H137.846154s-14.237538 15.970462-19.692308 46.828308c-32.748308 13.016615-59.076923 51.239385-59.076923 88.615385 0 38.951385 25.284923 71.660308 60.219077 83.534769C161.673846 857.639385 325.632 994.461538 521.846154 994.461538s360.172308-136.802462 402.550154-320.157538C959.330462 662.429538 984.615385 629.720615 984.615385 590.769231z"
              fill="${getColor(2, color, colors, '#FFD581')}"
            />
            <path
              d="M374.153846 620.307692m-39.384615 0a39.384615 39.384615 0 1 0 78.769231 0 39.384615 39.384615 0 1 0-78.769231 0Z"
              fill="${getColor(3, color, colors, '#414141')}"
            />
            <path
              d="M669.538462 620.307692m-39.384616 0a39.384615 39.384615 0 1 0 78.769231 0 39.384615 39.384615 0 1 0-78.769231 0Z"
              fill="${getColor(4, color, colors, '#414141')}"
            />
            <path
              d="M531.003077 731.746462A177.132308 177.132308 0 0 0 295.384615 817.230769a177.152 177.152 0 0 0 235.618462-85.484307zM531.692308 731.746462A177.152 177.152 0 0 1 767.310769 817.230769 177.132308 177.132308 0 0 1 531.692308 731.746462z"
              fill="${getColor(5, color, colors, '#414141')}"
            />
            <path
              d="M1004.307692 475.017846H19.692308a19.692308 19.692308 0 1 1 0-39.384615h984.615384a19.692308 19.692308 0 1 1 0 39.384615z"
              fill="${getColor(6, color, colors, '#3D324C')}"
            />
          </svg>
        ''';
        break;
      case IconNames.clown:
        svgXml = '''          <svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
            <path
              d="M518.920828 971.034483c198.550069 2.754207 309.318621-77.34731 370.899862-162.23338 63.611586-87.675586 84.109241-199.20331 64.388413-305.840551C882.829241 117.265655 518.920828 120.531862 518.920828 120.531862S155.030069 117.265655 83.650207 502.960552c-19.738483 106.637241 0.776828 218.14731 64.388414 305.840551 61.563586 84.868414 172.332138 164.987586 370.882207 162.23338z"
              fill="${getColor(0, color, colors, '#FDC794')}"
            />
            <path
              d="M300.155586 423.812414m-105.931034 0a105.931034 105.931034 0 1 0 211.862069 0 105.931034 105.931034 0 1 0-211.862069 0Z"
              fill="${getColor(1, color, colors, '#FFFFFF')}"
            />
            <path
              d="M706.224552 406.121931m-105.931035 0a105.931034 105.931034 0 1 0 211.862069 0 105.931034 105.931034 0 1 0-211.862069 0Z"
              fill="${getColor(2, color, colors, '#FFFFFF')}"
            />
            <path
              d="M933.764414 728.328828c-15.589517-67.336828-126.110897-105.94869-181.036138-29.996138-83.632552 115.641379-353.191724 125.422345-457.569104 33.138758-63.611586-56.231724-148.091586-9.18069-163.610482 52.241655 5.15531 8.527448 10.575448 16.93131 16.472276 25.070345 61.581241 84.868414 172.332138 164.987586 370.899862 162.23338 198.550069 2.754207 309.318621-77.34731 370.899862-162.23338a366.309517 366.309517 0 0 0 43.943724-80.45462z"
              fill="${getColor(3, color, colors, '#E64C3C')}"
            />
            <path
              d="M705.924414 670.949517a36.281379 36.281379 0 0 1-36.775724-35.592827c-0.335448-19.897379 34.727724-73.233655 34.992551-72.951173 0 0 37.040552 51.870897 37.376 71.768276a36.299034 36.299034 0 0 1-35.592827 36.775724z"
              fill="${getColor(4, color, colors, '#0096E6')}"
            />
            <path
              d="M79.430621 531.862069c-7.997793-7.574069-17.390345-12.129103-27.524414-12.129103-28.672 0-51.906207 34.974897-51.906207 78.106482 0 43.131586 23.234207 78.106483 51.888552 78.106483 12.129103 0 23.145931-6.532414 31.973517-17.019586a417.28 417.28 0 0 1-4.431448-127.064276zM1020.875034 464.295724c-9.939862-41.966345-40.606897-70.603034-68.484413-63.947034-8.66869 2.065655-15.854345 7.591724-21.627587 15.095172a570.968276 570.968276 0 0 1 23.446069 87.51669c2.736552 14.777379 4.608 29.643034 5.790897 44.526345 9.18069 5.014069 18.926345 7.097379 28.389517 4.837517 27.877517-6.638345 42.425379-46.062345 32.485517-88.02869z"
              fill="${getColor(5, color, colors, '#F9A671')}"
            />
            <path
              d="M245.406897 300.120276a17.602207 17.602207 0 0 1-12.482207-5.172966l-88.275862-88.275862a17.637517 17.637517 0 1 1 24.964413-24.964414l88.275862 88.275863a17.637517 17.637517 0 0 1-12.482206 30.137379zM298.390069 247.154759a17.655172 17.655172 0 0 1-15.819035-9.763311l-52.965517-105.931034a17.655172 17.655172 0 0 1 31.585104-15.80138l52.965517 105.931035a17.655172 17.655172 0 0 1-15.766069 25.56469zM368.993103 211.844414c-7.397517 0-14.283034-4.678621-16.754758-12.076138l-35.310345-105.931035a17.655172 17.655172 0 1 1 33.491862-11.175724l35.310345 105.931035a17.655172 17.655172 0 0 1-16.737104 23.251862zM457.25131 194.189241a17.655172 17.655172 0 0 1-17.390344-14.759724l-17.655173-105.931034a17.637517 17.637517 0 0 1 14.512552-20.303449 17.531586 17.531586 0 0 1 20.321103 14.512552l17.655173 105.931035a17.637517 17.637517 0 0 1-17.443311 20.55062zM527.889655 194.189241a17.655172 17.655172 0 0 1-17.655172-17.655172v-105.931035a17.655172 17.655172 0 1 1 35.310345 0v105.931035a17.655172 17.655172 0 0 1-17.655173 17.655172zM598.510345 194.189241a17.655172 17.655172 0 0 1-16.737104-23.251862l35.310345-105.931034a17.637517 17.637517 0 1 1 33.491862 11.175724l-35.310345 105.931034c-2.471724 7.397517-9.357241 12.076138-16.754758 12.076138zM669.131034 211.844414a17.655172 17.655172 0 0 1-16.737103-23.251862l35.310345-105.931035a17.637517 17.637517 0 1 1 33.491862 11.175724l-35.310345 105.931035c-2.471724 7.397517-9.357241 12.076138-16.754759 12.076138zM722.078897 247.154759a17.655172 17.655172 0 0 1-15.766069-25.547035l52.965517-105.931034a17.655172 17.655172 0 0 1 31.585103 15.801379l-52.965517 105.931034a17.655172 17.655172 0 0 1-15.819034 9.745656z"
              fill="${getColor(6, color, colors, '#5E5F62')}"
            />
            <path
              d="M323.654621 455.538759m-17.655173 0a17.655172 17.655172 0 1 0 35.310345 0 17.655172 17.655172 0 1 0-35.310345 0Z"
              fill="${getColor(7, color, colors, '#7F5B53')}"
            />
            <path
              d="M667.17131 400.295724m-17.655172 0a17.655172 17.655172 0 1 0 35.310345 0 17.655172 17.655172 0 1 0-35.310345 0Z"
              fill="${getColor(8, color, colors, '#7F5B53')}"
            />
            <path
              d="M514.348138 918.210207c-96.203034 0-192.088276-29.925517-267.828966-98.304a17.655172 17.655172 0 1 1 23.657931-26.200276c135.750621 122.544552 405.874759 128.953379 564.206345-45.885793a17.637517 17.637517 0 1 1 26.182621 23.693241c-81.972966 90.500414-214.386759 146.696828-346.217931 146.696828z"
              fill="${getColor(9, color, colors, '#FB7B76')}"
            />
            <path
              d="M529.655172 600.346483m-88.275862 0a88.275862 88.275862 0 1 0 176.551724 0 88.275862 88.275862 0 1 0-176.551724 0Z"
              fill="${getColor(10, color, colors, '#E64C3C')}"
            />
          </svg>
        ''';
        break;
      case IconNames.flirt:
        svgXml = '''          <svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
            <path
              d="M518.920828 971.016828c198.550069 2.754207 309.318621-77.34731 370.899862-162.23338 63.611586-87.675586 84.109241-199.20331 64.388413-305.840551C882.829241 117.265655 518.920828 120.514207 518.920828 120.514207S155.030069 117.265655 83.650207 502.960552c-19.738483 106.637241 0.776828 218.14731 64.388414 305.840551 61.563586 84.868414 172.332138 164.969931 370.882207 162.215725z"
              fill="${getColor(0, color, colors, '#FDC794')}"
            />
            <path
              d="M344.964414 381.457655a59.339034 59.339034 0 0 1 54.377931-35.592827c32.768 0 56.35531 27.065379 59.321379 59.321379 0 0 1.606621 8.015448-1.924414 22.422069-4.802207 19.632552-16.083862 37.075862-31.284965 50.387862l-80.507586 69.349517-79.148138-69.367172c-15.201103-13.312-26.482759-30.75531-31.284966-50.387862-3.531034-14.424276-1.924414-22.422069-1.924414-22.422069 2.966069-32.256 26.553379-59.321379 59.32138-59.32138 24.346483 0.017655 43.890759 14.671448 53.053793 35.610483z"
              fill="${getColor(1, color, colors, '#FB7B76')}"
            />
            <path
              d="M79.430621 531.862069c-7.997793-7.574069-17.390345-12.129103-27.524414-12.129103-28.672 0-51.906207 34.974897-51.906207 78.106482 0 43.131586 23.234207 78.106483 51.888552 78.106483 12.129103 0 23.145931-6.532414 31.973517-17.019586a417.28 417.28 0 0 1-4.431448-127.064276zM1020.875034 464.295724c-9.939862-41.966345-40.606897-70.603034-68.484413-63.947034-8.66869 2.065655-15.854345 7.591724-21.627587 15.095172a570.968276 570.968276 0 0 1 23.446069 87.51669c2.736552 14.777379 4.608 29.643034 5.790897 44.526345 9.18069 5.014069 18.926345 7.097379 28.389517 4.837517 27.877517-6.656 42.425379-46.062345 32.485517-88.02869z"
              fill="${getColor(2, color, colors, '#F9A671')}"
            />
            <path
              d="M245.406897 300.120276a17.602207 17.602207 0 0 1-12.482207-5.172966l-88.275862-88.275862a17.637517 17.637517 0 1 1 24.964413-24.964414l88.275862 88.275863a17.637517 17.637517 0 0 1-12.482206 30.137379zM298.390069 247.154759a17.655172 17.655172 0 0 1-15.819035-9.763311l-52.965517-105.931034a17.655172 17.655172 0 0 1 31.585104-15.80138l52.965517 105.931035a17.655172 17.655172 0 0 1-15.766069 25.56469zM368.993103 211.844414a17.637517 17.637517 0 0 1-16.737103-12.076138l-35.310345-105.931035a17.655172 17.655172 0 1 1 33.491862-11.175724l35.310345 105.931035a17.655172 17.655172 0 0 1-16.754759 23.251862zM457.25131 194.189241a17.655172 17.655172 0 0 1-17.390344-14.759724l-17.655173-105.931034a17.637517 17.637517 0 0 1 14.512552-20.303449 17.549241 17.549241 0 0 1 20.303448 14.512552l17.655173 105.931035a17.637517 17.637517 0 0 1-17.425656 20.55062zM527.889655 194.189241a17.655172 17.655172 0 0 1-17.655172-17.655172v-105.931035a17.655172 17.655172 0 1 1 35.310345 0v105.931035a17.655172 17.655172 0 0 1-17.655173 17.655172zM598.510345 194.189241a17.655172 17.655172 0 0 1-16.737104-23.251862l35.310345-105.931034a17.655172 17.655172 0 1 1 33.491862 11.175724l-35.310345 105.931034c-2.471724 7.397517-9.357241 12.076138-16.754758 12.076138zM669.131034 211.844414a17.655172 17.655172 0 0 1-16.737103-23.251862l35.310345-105.931035a17.655172 17.655172 0 1 1 33.491862 11.175724l-35.310345 105.931035c-2.471724 7.397517-9.357241 12.076138-16.754759 12.076138zM722.078897 247.154759a17.655172 17.655172 0 0 1-15.766069-25.547035l52.965517-105.931034a17.655172 17.655172 0 0 1 31.585103 15.801379l-52.965517 105.931034a17.690483 17.690483 0 0 1-15.819034 9.745656z"
              fill="${getColor(3, color, colors, '#5E5F62')}"
            />
            <path
              d="M801.403586 684.526345c0 83.208828-131.972414 222.72-294.770758 222.72S211.862069 767.735172 211.862069 684.526345s131.972414 26.200276 294.770759 26.200276 294.770759-109.409103 294.770758-26.200276z"
              fill="${getColor(4, color, colors, '#802D40')}"
            />
            <path
              d="M688.551724 459.087448m-141.241379 0a141.241379 141.241379 0 1 0 282.482758 0 141.241379 141.241379 0 1 0-282.482758 0Z"
              fill="${getColor(5, color, colors, '#FFFFFF')}"
            />
            <path
              d="M688.551724 459.087448m-52.965517 0a52.965517 52.965517 0 1 0 105.931034 0 52.965517 52.965517 0 1 0-105.931034 0Z"
              fill="${getColor(6, color, colors, '#7F5B53')}"
            />
            <path
              d="M506.632828 907.246345c60.663172 0 117.000828-19.403034 163.87531-48.004414-4.06069-42.072276-73.357241-75.581793-158.508138-75.581793-87.763862 0-158.896552 35.575172-158.896552 79.448276l-0.423724 1.694896c44.844138 25.423448 97.456552 42.443034 153.953104 42.443035z"
              fill="${getColor(7, color, colors, '#E64C3C')}"
            />
          </svg>
        ''';
        break;
      case IconNames.wrench:
        svgXml = '''          <svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
            <path
              d="M256 841.142857c0-20.004571-16.566857-36.571429-36.571429-36.571428s-36.571429 16.566857-36.571428 36.571428 16.566857 36.571429 36.571428 36.571429 36.571429-16.566857 36.571429-36.571429z m368.018286-239.981714L234.313143 990.866286c-13.129143 13.129143-32 21.138286-51.419429 21.138285s-38.290286-8.009143-52.004571-21.138285L70.326857 929.170286c-13.714286-13.129143-21.723429-32-21.723428-51.419429s8.009143-38.290286 21.723428-52.004571l389.156572-389.156572a294.765714 294.765714 0 0 0 164.571428 164.571429z m362.276571-248.576c0 18.870857-6.838857 42.276571-13.129143 60.562286C937.179429 514.852571 839.460571 585.142857 731.465143 585.142857c-141.129143 0-256-114.870857-256-256s114.870857-256 256-256c41.728 0 96 12.580571 130.852571 35.986286 5.705143 3.986286 9.142857 9.142857 9.142857 16.018286a20.333714 20.333714 0 0 1-9.142857 16.018285l-167.424 96.585143v128l110.299429 61.147429c18.870857-10.861714 151.442286-94.281143 162.852571-94.281143s18.285714 8.557714 18.285715 20.004571z"
              fill="${getColor(0, color, colors, '#333333')}"
            />
          </svg>
        ''';
        break;
      case IconNames.filter_fill:
        svgXml = '''          <svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
            <path
              d="M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196z m531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z"
              fill="${getColor(0, color, colors, '#333333')}"
            />
          </svg>
        ''';
        break;
      case IconNames.yuangongguanli:
        svgXml = '''          <svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
            <path
              d="M953.949091 740.957091a69.352727 69.352727 0 0 0-20.200727-43.706182c-15.546182-5.585455-40.448 16.244364-65.815273 0-30.068364-21.876364-10.379636-54.365091-20.200727-76.241454a55.854545 55.854545 0 0 0-50.269091-21.829819c-20.200727 27.461818-15.034182 43.706182-55.482182 43.706182-40.448-5.585455-30.580364-43.706182-60.509091-43.706182a40.634182 40.634182 0 0 0-40.448 21.876364 105.797818 105.797818 0 0 1-9.867636 65.582545c-25.413818 21.271273-40.448 0-65.815273 10.65891a45.893818 45.893818 0 0 0-20.200727 49.338181c5.166545 21.876364 40.448 27.461818 40.448 59.950546 0 43.752727-35.234909 43.752727-40.448 59.997091a54.504727 54.504727 0 0 0 15.034181 54.365091c10.379636 10.658909 40.448-11.217455 65.815273 10.658909a52.410182 52.410182 0 0 1 5.166546 59.950545 60.834909 60.834909 0 0 0 55.482181 32.581818c20.200727 0 20.200727-43.706182 60.509091-43.706181 30.580364 0 30.580364 21.876364 45.614546 38.120727 9.821091 11.217455 40.448-5.585455 55.482182-16.244364 9.821091-10.658909-9.867636-32.581818 0-59.950545a52.689455 52.689455 0 0 1 25.413818-21.829818 151.319273 151.319273 0 0 1 50.269091 0 72.890182 72.890182 0 0 0 20.200727-54.365091c-5.166545-16.802909-35.234909-11.217455-40.448-49.338182-5.213091-49.524364 40.401455-43.938909 50.269091-75.869091z m-191.813818 168.680727C646.004364 930.909091 600.203636 740.072727 721.687273 707.490909c141.544727-27.601455 157.090909 174.685091 40.448 202.193455z m-247.249455-393.402182A224.768 224.768 0 0 1 297.658182 281.367273 224.768 224.768 0 0 1 514.885818 46.545455a224.768 224.768 0 0 1 217.227637 234.821818 228.072727 228.072727 0 0 1-217.227637 234.868363z m176.872727 54.365091s-80.896 0-75.682909 59.950546c5.166545 65.582545-75.682909 16.244364-90.717091 71.168-20.200727 65.582545 9.821091 54.365091 25.413819 98.071272 9.867636 27.461818-40.448 43.706182-35.234909 93.09091 9.867636 65.582545 60.509091 32.581818 75.682909 71.168 9.867636 32.581818-25.413818 54.365091-106.263273 54.36509-65.815273 0-191.813818 0-237.381818-5.585454 0 0-131.165091-5.585455-131.165091-98.071273a388.282182 388.282182 0 0 1 75.682909-234.821818 308.782545 308.782545 0 0 1 232.261818-119.947636z"
              fill="${getColor(0, color, colors, '#808080')}"
            />
          </svg>
        ''';
        break;
      case IconNames.shezhi:
        svgXml = '''          <svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
            <path
              d="M880.037 461.451c-2.896-16.078-18.396-32.444-34.473-36.066l-12.021-2.751c-28.244-8.547-53.302-27.232-69.234-54.751-15.933-27.665-19.701-59.097-12.748-87.917l3.767-11.299c4.779-15.643-1.45-37.223-14.049-47.943 0 0-11.299-9.559-43.164-27.954-31.866-18.25-45.626-23.319-45.626-23.319-15.499-5.648-37.224-0.289-48.522 11.733l-8.403 8.98c-21.436 20.278-50.26 32.589-82.123 32.589s-60.976-12.454-82.415-32.878l-8.114-8.692c-11.153-12.021-33.022-17.378-48.522-11.732 0 0-13.904 5.069-45.77 23.318-31.866 18.54-43.018 28.099-43.018 28.099-12.6 10.574-18.829 32.010-14.049 47.798l3.479 11.442c6.807 28.822 3.185 60.11-12.748 87.772s-41.273 46.497-69.659 54.899l-11.587 2.606c-15.933 3.622-31.577 19.844-34.473 36.066 0 0-2.606 14.483-2.606 51.273s2.606 51.273 2.606 51.273c2.896 16.222 18.395 32.444 34.473 36.066l11.299 2.606c28.388 8.403 53.88 27.232 69.813 55.040 15.933 27.666 19.701 59.097 12.748 87.918l-3.33 11.153c-4.779 15.643 1.45 37.223 14.048 47.943 0 0 11.299 9.559 43.164 27.954s45.625 23.319 45.625 23.319c15.499 5.647 37.224 0.289 48.522-11.733l7.966-8.547c21.579-20.423 50.549-32.878 82.56-32.878s61.121 12.6 82.56 33.022l7.966 8.547c11.153 12.021 33.022 17.383 48.522 11.732 0 0 13.904-5.069 45.77-23.318 31.866-18.396 43.018-27.954 43.018-27.954 12.6-10.574 18.829-32.154 14.048-47.943l-3.479-11.588c-6.807-28.677-3.185-59.964 12.748-87.484 15.933-27.666 41.424-46.638 69.813-55.040l11.299-2.606c15.933-3.622 31.577-19.844 34.473-36.066 0 0 2.606-14.483 2.606-51.273-0.152-36.937-2.759-51.421-2.759-51.421zM513.45 660.027c-81.256 0-147.303-65.901-147.303-147.303 0-81.256 65.901-147.159 147.303-147.159 81.256 0 147.303 65.901 147.303 147.303-0.148 81.256-66.049 147.159-147.303 147.159z"
              fill="${getColor(0, color, colors, '#333333')}"
            />
          </svg>
        ''';
        break;
      case IconNames.gengduo:
        svgXml = '''          <svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
            <path
              d="M844.119259 381.215149L682.39162 542.942788c-11.551974 11.551974-28.879936 11.551974-40.43191 0L481.057212 381.215149c-11.551974-11.551974-11.551974-28.879936 0-40.43191l161.727639-160.902498c11.551974-11.551974 28.879936-11.551974 40.43191 0l160.902498 161.727639c11.551974 10.726833 11.551974 28.879936 0 39.606769z m-415.871072 471.15552H199.684126c-15.677679 0-28.879936-12.377115-28.879936-28.879936V595.751813c0-15.677679 12.377115-28.879936 28.879936-28.879935h228.564061c15.677679 0 28.879936 12.377115 28.879935 28.879935v228.564061c0 15.677679-12.377115 28.054795-28.879935 28.054795z m0-342.433522H199.684126c-15.677679 0-28.879936-12.377115-28.879936-28.879935V253.318292c0-15.677679 12.377115-28.879936 28.879936-28.879936h228.564061c15.677679 0 28.879936 12.377115 28.879935 28.879936v228.564061c0 15.677679-12.377115 28.054795-28.879935 28.054794z m113.86946 56.934731h228.564061c15.677679 0 28.879936 12.377115 28.879936 28.879935v228.564061c0 15.677679-12.377115 28.879936-28.879936 28.879936H542.117647c-15.677679 0-28.879936-12.377115-28.879935-28.879936V595.751813c0.825141-16.50282 13.202256-28.879936 28.879935-28.879935z"
              fill="${getColor(0, color, colors, '#999999')}"
            />
          </svg>
        ''';
        break;
      case IconNames.qunzu:
        svgXml = '''          <svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
            <path
              d="M384.085333 384m-170.666666 0a170.666667 170.666667 0 1 0 341.333333 0 170.666667 170.666667 0 1 0-341.333333 0Z"
              fill="${getColor(0, color, colors, '#444444')}"
            />
            <path
              d="M341.333333 597.333333h85.333334a256 256 0 0 1 256 256H85.333333a256 256 0 0 1 256-256z"
              fill="${getColor(1, color, colors, '#444444')}"
            />
            <path
              d="M682.752 597.333333a256 256 0 0 1 255.786667 246.4l0.213333 9.6H725.333333a298.410667 298.410667 0 0 0-144-255.530666c5.290667-0.298667 10.666667-0.469333 16.085334-0.469334h85.333333z m-85.333333-384A170.666667 170.666667 0 1 1 529.066667 540.458667 212.650667 212.650667 0 0 0 597.418667 384a212.736 212.736 0 0 0-68.266667-156.416A169.216 169.216 0 0 1 597.418667 213.333333z"
              fill="${getColor(2, color, colors, '#444444')}"
            />
          </svg>
        ''';
        break;

    }

    return SvgPicture.string(svgXml, width: size, height: size);
  }
}
